import request from '@/utils/request'
import qs from 'qs'

// api/roles/all
export const getRolesAll = params => {
  return request({
    url: 'api/roles/all',
    params
  })
}

// 查询角色 role/page
export const getRole = params => {
  return request({
    url: '/role/page?' + qs.stringify(params),
    method: 'POST'
  })
}

// /role/save 新增角色
export const saveRoleSave = data => {
  return request({
    url: '/role/save',
    method: 'POST',
    data
  })
}

// 删除角色
export const delRole = params => {
  return request({
    url: '/role/delete?' + qs.stringify(params),
    method: 'POST'
  })
}

// /role/queryList 查询所有有效角色列表
export const queryRoleList = params => {
  return request({
    url: '/role/queryList',
    method: 'POST'
  })
}

// /role/query 查询角色信息
export const queryRole = params => {
  return request({
    url: '/role/query?' + qs.stringify(params),
    method: 'POST'
  })
}
